﻿using EmitMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Framework.Common
{
    public static class MapperExtension
    {
        /// <summary>
        /// 将对象映射到一个新的对象
        /// </summary>
        /// <param name="from">源对象</param>
        /// <param name="ignoreMembers">忽略属性列表</param>
        /// <returns></returns>
        public static TTo MapNew<TFrom, TTo>(this TFrom from, params string[] ignoreMembers) where TFrom : class
        {
            return Mapper.MapNew<TFrom, TTo>(from,ignoreMembers);
        }
    }
}
